<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    /* 联系我们 */
    .nav-list {
      display: flex;
      justify-content: center;
      align-items: center;
      list-style: none;
      background-color: red;
    }
    li {
      padding: 20px 50px;
      color: white;
      white-space: nowrap;
    }
    /* 媒体查询 */
    /* 弹性布局示例 */
    .flex-container {
      display: flex;
      gap: 20px;
      margin-bottom: 30px;
    }
    .flex-item {
      flex: 1;
      background-color: pink;
      border-radius: 8px;
      padding: 20px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }

    /* 响应式导航栏 */
    @media (max-width: 1024px) and (min-width: 769px) {
      .nav-list {
        background: linear-gradient(90deg, #f39c12, #e74c3c);
      }
    }
  
    @media (max-width: 768px) and (min-width: 481px) {
      .nav-list {
        background: linear-gradient(90deg, #9b59b6, #34495e);
        flex-direction: column;
      }
      .flex-container {
        flex-direction: column;
      }
    }
    @media (max-width: 480px) and (min-width: 0) {
      .nav-list {
        background: pink;
        flex-direction: column;
        border-radius: 30px;
      }
    }
  </style>
  <body>
    <ul class="nav-list">
      <li>首页</li>
      <li>产品</li>
      <li>服务</li>
      <li>关于我们</li>
      <li>联系我们</li>
    </ul>

    <h2>弹性布局示例</h2>
    <div class="flex-container">
      <div class="flex-item">
        <h3>弹性项 1</h3>
        <p>在大屏幕上并排显示，在手机上垂直堆叠。</p>
      </div>
      <div class="flex-item">
        <h3>弹性项 2</h3>
        <p>使用Flexbox实现响应式布局。</p>
      </div>
      <div class="flex-item">
        <h3>弹性项 3</h3>
        <p>媒体查询控制不同断点下的排列方向。</p>
      </div>
    </div>
  </body>
</html>
